﻿
Partial Class Master_BoxOffice
    Inherits System.Web.UI.MasterPage

    ''' <summary>
    ''' Register an external JavaScript file inside the HEAD tag
    ''' </summary>
    ''' <param name="control">The ContentPlaceHolder control within the HEAD tag</param>
    ''' <param name="relativePath">The path to the script file relative to the application</param>
    ''' <remarks></remarks>
    Protected Sub RegisterScriptSource(ByVal control As ContentPlaceHolder, ByVal relativePath As String)
        Dim basePath As String = EndWith(Request.ApplicationPath, "/")
        Dim src As String = String.Format("{0}{1}", basePath, relativePath.Trim("/"))
        Dim scr As New HtmlGenericControl("script")
        With scr.Attributes
            .Add("type", "text/javascript")
            .Add("src", src)
        End With
        control.Controls.Add(scr)
    End Sub

End Class

